#!/usr/bin/env python
#coding=utf-8

import string
import sys
#sys.path.append('..')
from optparse import OptionParser
from lib.kernel import core
from lib import func_ext
from lib import abstract_cron

if __name__ == '__main__' :
    '''
    objCron = abstract_cron.abstract_cron(__file__)
    print objCron.GetInsertSql('sdb_test',{'a':1,'b':'cc',3:45})
    print objCron.writeSql('sdb_test','succ','insert')
    '''

    '''
    objMongo = core().mongo()
    coll = objMongo.shopex_certi.bind_info
    cur = coll.find().limit(5)
    for v in cur :
        print v
    '''

    #'''
    #obj = core().database()
    #batchKeys = [1.0,'name','value','time']
    #print obj.getBatchInsertSql('test',batchKeys)
    #batchData = [(1.0,2),(3.1,4),(5,6)]
    #batchSql = 'INSERT INTO example(`name`,`value`)VALUES(%s,%s)'
    #obj.batchExec(batchSql,batchData)
    
    #print obj.query('select * from example where id="8"')
    #print obj.selectRow('select * from example where id="8"')
    #print obj.rowCount()
    #print obj._getFilterType('in',[0,1])
    #print obj._filter({'a':1,'b|has':'rt','c|in':[2,3,4]},'sdb_test')
    #print globals()
    #'''

    '''
    l = [1,34,'a',[45,76,'b']]
    print l
    print func_ext.list2str(l)
    print func_ext.list2str(l,True)
    '''

    #'''
    l = ['today','yesterday','week','last_week','month','last_month']
    #print ' in ("'+'","'.join(l)+'") '

    for k,v in enumerate(l)  :
        #print k,v
        #l[k]= l[k]+'_1'
        print func_ext.dateTypeInterval(v)

    #print l
    #'''